/*
 * Copyright 2004-2005 aosft
 * 本软件及其所有拷贝的名称，与光盘上或本软件中注明的公司同在。
 * 本软件及文档享有版权，并受国家版权法及国际协约条款的保护。
 * 您不可以从本软件中去掉其版权声明；并保证为本软件的拷贝（本部或部分）* 复制版权声明。
 * 您同意制止以任何形式非法拷贝本软件及文档。
 * 版权信息参见：
 *      http://www.asoft.cn/licenses
 */

package com.asoft.examonline.teach.view.foreveryone;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

import com.asoft.common.base.model.BaseObject;
import com.asoft.common.base.web.view.AddFuncButton;
import com.asoft.common.base.web.view.BaseObjectListTemplet;
import com.asoft.common.base.web.view.ConfigColumnFuncButton;
import com.asoft.common.base.web.view.DelFuncButton;
import com.asoft.common.base.web.view.ExportFuncButton;
import com.asoft.common.base.web.view.FuncButton;
import com.asoft.common.base.web.view.FuncItem;
import com.asoft.common.base.web.view.Item;
import com.asoft.common.base.web.view.Item4ChangePri;
import com.asoft.common.base.web.view.Item4CheckBox;
import com.asoft.common.base.web.view.Item4HtmlPreview;
import com.asoft.common.base.web.view.PrintFuncButton;
import com.asoft.common.base.web.view.QueryFuncButton;
import com.asoft.common.base.web.view.Title;
import com.asoft.common.base.web.view.Title4CheckBox;
import com.asoft.common.base.web.view.Title4Sort;
import com.asoft.common.base.web.view.UpdateFuncButton;
import com.asoft.examonline.teach.model.TeachResource;

/**
 * <p>Title: 教学资源结果列表</p>
 * <p>Description:
 *   /--功能按钮--/  /--功能切换区--/ <br>
 *   /--       记录标题区       --/<br>
 *   /--       记录列表        --/<br>
 * </p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: aosft</p>
 * @ $Author: author $
 * @ $Date: 2005/02/16 01:04:14 $
 * @ $Revision: 1.7 $
 * @ created in 2005-11-14
 *
 */

public class TeachResourceList4EveryOne extends BaseObjectListTemplet
{
        static Logger logger = Logger.getLogger(TeachResourceList4EveryOne.class);

        /** 功能按钮区 */
        public List getButtons(String contextPath)
        {
               List<FuncButton> fbs = new ArrayList<FuncButton>();
               // new Add、Update、Del、Query、Print、COnfigColumnFuncButton(onclick事件函数名) (按钮显示文本,onclick事件函数名)
               fbs.add(new AddFuncButton());
               fbs.add(new UpdateFuncButton());
               fbs.add(new DelFuncButton());
               fbs.add(new QueryFuncButton());
               fbs.add(new ExportFuncButton());
               fbs.add(new PrintFuncButton());
               fbs.add(new ConfigColumnFuncButton());
               return fbs;
        }

        /** 功能切换区 */
        public List getChanges(String contextPath)
        {
               List<FuncItem> fis = new ArrayList<FuncItem>();
               // new FuncItem(功能切换名,是否聚焦,onclick对应函数名);
               fis.add(new FuncItem("教学资源"));
               return fis;
        }

        /** 明细标题区 */
        public List getTitles(String contextPath)
        {
                List<Title> titles = new ArrayList<Title>();
                // 当前页所有model全选
                titles.add(new Title4CheckBox());
                titles.add(new Title4Sort("优先级","tr.pri"));
                titles.add(new Title4Sort("标题","tr.title"));
                titles.add(new Title4Sort("领域","tr.knowledgePoint.superType.superType.superType.superType.superType.pri"));
                titles.add(new Title4Sort("学科","tr.knowledgePoint.superType.superType.superType.superType.pri"));
                titles.add(new Title4Sort("课程","tr.knowledgePoint.superType.superType.superType.pri"));
                titles.add(new Title4Sort("章","tr.knowledgePoint.superType.superType.pri"));
                titles.add(new Title4Sort("节","tr.knowledgePoint.superType.pri"));
                titles.add(new Title4Sort("知识点","tr.knowledgePoint.pri"));
                titles.add(new Title4Sort("难度","tr.difficulty.pri"));
                
                titles.add(new Title("标准"));
                titles.add(new Title("电子课文"));
                titles.add(new Title("经典例题"));
                titles.add(new Title("教学设计"));
                titles.add(new Title("精美课件"));
                
                titles.add(new Title("视频动画"));
                titles.add(new Title("背景资料"));
                titles.add(new Title("百家争鸣"));
                
                titles.add(new Title4Sort("出版社","tr.publicCompany.pri"));
                titles.add(new Title4Sort("主编","tr.authorName"));
                return titles;
        }

        /** 明细区 */
        public List getItems(String contextPath,BaseObject model)
        {
                TeachResource teachResource = (TeachResource)model;
                List<Item> items = new ArrayList<Item>();
                // 本model选择框;
                items.add(new Item4CheckBox(teachResource.getId()));
                items.add(new Item4ChangePri(teachResource));
                items.add(new Item(teachResource.getTitle()));
                items.add(new Item(teachResource.getKnowledgePoint().getSuperType().getSuperType().getSuperType().getSuperType().getSuperType().getName()));
                items.add(new Item(teachResource.getKnowledgePoint().getSuperType().getSuperType().getSuperType().getSuperType().getName()));
                items.add(new Item(teachResource.getKnowledgePoint().getSuperType().getSuperType().getSuperType().getName()));
                items.add(new Item(teachResource.getKnowledgePoint().getSuperType().getSuperType().getName()));
                items.add(new Item(teachResource.getKnowledgePoint().getSuperType().getName()));
                items.add(new Item(teachResource.getKnowledgePoint().getName()));
                items.add(new Item(teachResource.getDifficulty().getName()));
                
                items.add(new Item4HtmlPreview(teachResource.getStandard()));
                items.add(new Item4HtmlPreview(teachResource.getElecText()));
                items.add(new Item4HtmlPreview(teachResource.getClassicQuest()));
                items.add(new Item4HtmlPreview(teachResource.getTeachDesign()));
                items.add(new Item4HtmlPreview(teachResource.getCourseWare()));
                
                items.add(new Item4HtmlPreview(teachResource.getVideo()));
                items.add(new Item4HtmlPreview(teachResource.getBackGround()));
                items.add(new Item4HtmlPreview(teachResource.getOthers()));
                
                items.add(new Item(teachResource.getPublishCompany().getName()));
                items.add(new Item(teachResource.getAuthorName()));
                return items;
        }
}
